package EcoSpeed;

/**
 * Class Zone
 * Classe de description d'une zone
 */
public class Zone {
    /**
     * Etage de debut de la zone.
     * @startFloor < @endFloor
     */
    private int startFloor;
    /**
     * Etage de fin de la zone.
     * @startFloor < @endFoor
     */
    private int endFloor;
    /**
     * Etage de prédilection d'une zone
     */
    private int bestFloor;

    /**
     * Set the value of startFloor
     * Etage de debut de la zone.
     * @startFloor < @endFloor
     * @param newVar the new value of startFloor
     */
    private void setStartFloor ( int newVar ) {
        startFloor = newVar;
    }

    /**
     * Get the value of startFloor
     * Etage de debut de la zone.
     * @startFloor < @endFloor
     * @return the value of startFloor
     */
    public int getStartFloor ( ) {
        return startFloor;
    }

    /**
     * Set the value of endFloor
     * Etage de fin de la zone.
     * @startFloor < @endFoor
     * @param newVar the new value of endFloor
     */
    private void setEndFloor ( int newVar ) {
        endFloor = newVar;
    }

    /**
     * Get the value of endFloor
     * Etage de fin de la zone.
     * @startFloor < @endFoor
     * @return the value of endFloor
     */
    public int getEndFloor ( ) {
        return endFloor;
    }

    /**
     * Set the value of bestFloor
     * Etage de prédilection d'une zone
     * @param newVar the new value of bestFloor
     */
    private void setBestFloor ( int newVar ) {
        bestFloor = newVar;
    }

    /**
     * Get the value of bestFloor
     * Etage de prédilection d'une zone
     * @return the value of bestFloor
     */

    public int getBestFloor ( ) {
        return bestFloor;
    }

    /**
     * Modificateur de la zone
     * @param        newStartFloor Nouvel étage de debut
     * @param        newEndFloor Nouvel étage de fin
     * @param        newBestFloor Nouvel étage de prédilection
     */
    public void updateZone( int newStartFloor, int newEndFloor, int newBestFloor ) {
        if (newStartFloor>=0 && newStartFloor<Utils.NB_FLOORS){
            this.setStartFloor(newStartFloor);
	}

        if (newEndFloor>=0 && newEndFloor<Utils.NB_FLOORS){
            this.setEndFloor(newEndFloor);
	}

        if (newBestFloor>=0 && newBestFloor<Utils.NB_FLOORS){
            this.setBestFloor(newBestFloor);
	}
    }


}
